package com.ccom.api.feign.factory;

import com.ccom.api.feign.SysLogFeign;
import com.ccom.api.feign.fallback.BaseLogFeignFallback;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 日志服务降级处理
 */
@Component
public class BaseLogFallbackFactory implements FallbackFactory<SysLogFeign> {
    @Override
    public SysLogFeign create(Throwable throwable) {
        BaseLogFeignFallback fallback = new BaseLogFeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
